package com.web;

import com.pojo.ZhiShi_x;
import com.service.ZhiShiService_x;
import com.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/zhishi")
public class ZhiShiController_x {
    @Autowired
    private ZhiShiService_x zhiShiServiceX;
    @RequestMapping("/select")
    public Result selectAll() {
        return Result.ok(zhiShiServiceX.selectAll());
    }
    @RequestMapping("show")
    public Result select1(){
        return Result.ok(zhiShiServiceX.select1());
    }
    @RequestMapping("/select2")
    public Result selectAll2(Integer id,String title,String content){
        return Result.ok(zhiShiServiceX.selectAll2(id,title,content));
    }
    @RequestMapping("add")
    Result add(ZhiShi_x zhiShiX){
        return Result.ok(zhiShiServiceX.add(zhiShiX));
    }
    @RequestMapping("update")
    Result update(ZhiShi_x zhiShiX){
        return Result.ok(zhiShiServiceX.update(zhiShiX));
    }
    @RequestMapping("delete")
    Result delete(Integer id){
        return Result.ok(zhiShiServiceX.delete(id));
    }
}
